package main

import (
	"fmt"
	"sort"
)

type person struct {
	a int
	b int
	c int
}

func maxint(a, b int) int {
	if a > b {
		return a
	}
	return b
}

type money interface {
	dontneedswapperson(person) bool
}

// nextperson是下一个大臣的左手和右手，小于号右边的是交换后的最大钱数。
// 当返回true时，说明交换前最大钱小于交换后的，则不应该交换。
func (r person) dontneedswapperson(nextperson person) bool {
	return maxint(nextperson.b, r.a*r.b) < maxint(r.b, nextperson.a*nextperson.b)
}

type byc []person

func (a byc) Len() int           { return len(a) }
func (a byc) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a byc) Less(i, j int) bool { return a[i].c < a[j].c }

const Len = 4000 + 1
const base = 10000

type bint struct {
	len int
	v   [Len]int
}

type calculator interface {
	init(int)
	assignment() bint
	lessthan(bint) bool
	print()
	multiply(int) bint
	divide(int) bint
}

func (this *bint) init(r int) {
	for this.len = 0; r > 0; r /= base {
		this.v[this.len] = r % base
		this.len++
	}
}

func (this bint) assignment() bint {
	return this
}

func (this *bint) lessthan(another *bint) bool {
	if this.len < another.len {
		return true
	}
	for i := this.len - 1; i >= 0; i-- {
		if this.v[i] != another.v[i] {
			return this.v[i] < another.v[i]
		}
	}
	return false
}

func (this *bint) print() {
	var tmp int
	if this.len == 0 {
		tmp = 0
	} else {
		tmp = this.v[this.len-1]
	}
	fmt.Printf("%d", tmp)
	for i := this.len - 2; i >= 0; i-- {
		fmt.Printf("%04d", this.v[i])
	}
}

func (this *bint) multiply(r int) bint {
	var ans bint
	ans.init(0)
	carry := 0
	var i int
	for i = 0; i < this.len || carry != 0; i++ {
		if i < this.len {
			carry += this.v[i] * r
		}
		ans.v[i] = carry % base
		carry /= base
	}
	ans.len = i
	return ans
}

func (this *bint) divide(b int) bint {
	ans := this.assignment()
	carry := 0
	for i := ans.len - 1; i >= 0; i-- {
		ans.v[i] = carry*base + ans.v[i]
		carry = ans.v[i] % b
		ans.v[i] /= b
	}
	// ans.print()
	// fmt.Printf("\nans.len=%d\n", ans.len)
	for ans.len != 0 && ans.v[ans.len-1] == 0 {
		// fmt.Printf("\n\nlen=%d\n", ans.len)
		ans.len--
	}
	return ans
}

func gmax(a *bint, b *bint) {
	if a.lessthan(b) {
		*a = *b
	}
}

func main() {
	var n, a, b int
	fmt.Scanf("%d", &n)
	// fmt.Printf("%d %d\n", a, b)
	fmt.Scanf("%d%d", &a, &b)
	var Person [1005]person
	for i := 1; i <= n; i++ {
		fmt.Scanf("%d%d", &Person[i].a, &Person[i].b)
		Person[i].c = Person[i].a * Person[i].b
	}
	sub := Person[1 : n+1]
	// fmt.Printf("\n\n%d\n", len(sub))

	sort.Sort(byc(sub))
	var to, ans bint
	to.init(a)
	ans.init(0)
	for i := 1; i <= n; i++ {
		tmp := to.divide(Person[i].b)
		// tmp.print()
		// fmt.Println("")
		gmax(&ans, &tmp)
		to = to.multiply(Person[i].a)
	}
	ans.print()
}
